﻿using System;
using System.Collections;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Services;
using System.Web.Services.Protocols;
using System.Xml.Linq;

namespace YXShop.Web.filehandle
{
    /// <summary>
    /// $codebehindclassname$ 的摘要说明
    /// </summary>
    [WebService(Namespace = "http://tempuri.org/")]
    [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
    public class product_collection_form : IHttpHandler
    {
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";
            if (context.Session["MemberID"] == null)
            {
                ChangeHope.WebPage.Script.AlertAndGoBack("温馨提示：登录以后才能加入收藏！");
            }
            YXShop.BLL.Accessories.Collection bll = new YXShop.BLL.Accessories.Collection();
            YXShop.Model.Accessories.Collection model = new YXShop.Model.Accessories.Collection();
            model.CollectionId = ChangeHope.WebPage.PageRequest.GetQueryInt("q_productid");
            model.CollectionType = 2;
            model.CollectionName = context.Session["MemberName"].ToString();
            model.CollectionUid = Convert.ToInt32(context.Session["MemberID"].ToString());
            model.CollectionDate = DateTime.Now;
            bll.Add(model);
            context.Response.Write("ok");
            context.Response.End();
        }

        public bool IsReusable
        {
            get
            {
                return false;
            }
        }
    }
}
